package org.example.Thread;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:Lenovo
 * Date:2022-03-22
 * Time:14:48
 */
public class Demo13 {
    public static void main(String[] args) {
        java.lang.Thread t = new java.lang.Thread(){
            @Override
            public void run() {
                System.out.println(java.lang.Thread.currentThread().getName());
            }
        };
        t.start();

        //这个操作是在main线程中使用，拿到的就是main这个线程的实例
        System.out.println(java.lang.Thread.currentThread().getName());
    }
}
